<?php
$name="";
$conn = mysql_connect('localhost', 'root', 'vertrigo');
mysql_select_db('tdc', $conn);
if(isset($_POST['ok']))
{
	if($_POST['txtname']==NULL)
	{
		echo"Vui long nhap ten nhan vien";
	}
	else
	{
		$name=$_POST['txtname'];
	}
	if($name)
	{
		$sql="INSERT INTO staff (staff_name) VALUES ('$name');";
		$query=mysql_query($sql);
		header("location:staff.php");
		exit(0);
		
	}
}
?>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	</head>
	<body>
		<form action="add_Staff.php" method="POST">
			<table>
				<tr>
					<td>Name:</td><td><input type="text" size="25" name="txtname"/></td>
				</tr>
				<tr>
					<td></td>
					<td><input type="submit" value="Add" name="ok"</td>
				</tr>
					
			</table>
		</form>
	</body>
</html>